{extend name="public/base"/}
{block name="body"}
<div class="row">
  <div class="col-md-4 col-sm-12 col-xs-12 col-md-offset-4">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
      <form class="layui-form layui-form-pane" action="{:request()->url()}" method="post">
        <div class="layui-form-item">
          <label class="layui-form-label">原密码</label>
          <div class="layui-input-block">
            <input name="old" autocomplete="off" placeholder="请输入原密码" class="layui-input" type="password" lay-verify="required">
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">新密码</label>
          <div class="layui-input-block">
            <input name="password" autocomplete="off" placeholder="请输入新密码" class="layui-input" type="password" lay-verify="required">
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">确认密码</label>
          <div class="layui-input-block">
            <input name="repassword" autocomplete="off" placeholder="请输入确认密码" class="layui-input" type="password" lay-verify="required">
          </div>
        </div>
        <div class="layui-form-item">
          <button class="btn btn-success col-md-12 col-sm-12 col-xs-12" lay-submit="" lay-filter="formLogin">提交</button>
        </div>
      </form>
    </div>
  </div>
</div>
{/block}

{block name="side"}{/block}
{block name="script"}
	<script type="text/javascript">


    	$("form").submit(function(){
    		var self = $(this);
    		$.post(self.attr("action"), self.serialize(), success, "json");
    		return false;

    		function success(data){
    			if(data.code){
                    layer_success(data.msg);
                    setTimeout(function(){
                        window.location.href = data.url;
                    },1500);
    			} else {
    				layer_error(data.msg)
    			}
    		}
    	});
	</script>
{/block}
